{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "%matplotlib inline\n",
    "import pandas as pd\n",
    "import matplotlib.pyplot as plt\n",
    "import matplotlib\n",
    "import numpy as np\n",
    "import seaborn as sns\n",
    "import string\n",
    "#https://stackoverflow.com/questions/19726663/how-to-save-the-pandas-dataframe-series-data-as-a-figure\n",
    "import six\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "tbpath = \"../../fits/\"\n",
    "productpath = \"../../postfit_derivatives/\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "models = [\"fulllinearmodel_fit_table.csv\",\"reducedlinearmodelNegBinom_fit_table.csv\",\n",
    "          \"reducedlinearmodelq0_fit_table.csv\",\"reducedlinearmodelq0ctime_fit_table.csv\",\n",
    "         \"nonlinearmodelq0ctime_fit_table.csv\",\"nonlinearmodel_fit_table.csv\"]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "rois = []\n",
    "for model in models:\n",
    "    df = pd.read_csv(tbpath + model) #get rois in all tables (some may have failed)\n",
    "    rois += list(df.roi.unique())\n",
    "\n",
    "    \n",
    "rois = list(set(rois))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "theta_ = [\"R0\"]#,\"Rlast\"] #need to update Rlast\n",
    "\n",
    "\n",
    "dfreport = pd.DataFrame(columns=['Region', 'Model','median '+theta_[0],'CI lower','CI upper'])#,'median '+theta_[1],'CI lower','CI upper'])\n",
    "k = -1\n",
    "for roi in rois:\n",
    "    try:\n",
    "        k += 1\n",
    "        model = \"fulllinearmodel_fit_table.csv\" \n",
    "        df = pd.read_csv(tbpath + model)\n",
    "        theta = theta_[0]\n",
    "        measure1 = df.loc[(df.roi==roi)&(df['quantile']==0.5),theta].values[0]\n",
    "        measure2 = df.loc[(df.roi==roi)&(df['quantile']==0.025),theta].values[0]\n",
    "        measure3 = df.loc[(df.roi==roi)&(df['quantile']==0.975),theta].values[0]\n",
    "        x = [roi,model.split('_fit_table.csv')[0],np.round(measure1,4),np.round(measure2,4),np.round(measure3,4)]\n",
    "    #         theta = theta_[1]\n",
    "    #         measure1 = df.loc[(df.roi==roi)&(df['quantile']==0.5),theta].values[0]\n",
    "    #         measure2 = df.loc[(df.roi==roi)&(df['quantile']==0.025),theta].values[0]\n",
    "    #         measure3 = df.loc[(df.roi==roi)&(df['quantile']==0.975),theta].values[0]\n",
    "    #         x += [np.round(measure1,4),np.round(measure2,4),np.round(measure3,4)]\n",
    "        dfreport.loc[k] = x\n",
    "    except:\n",
    "        print(roi)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "4.54025\n",
      "0.025    1.933833\n",
      "0.500    4.540250\n",
      "0.975    8.370410\n",
      "Name: median R0, dtype: float64\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAA1MAAAE0CAYAAADJ1mlXAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8QZhcZAAAgAElEQVR4nO3deXyNZ/7/8fcViUQSIST2bRoapcrUFmqJIxU12tH+0E1Vo0q/anyrykQ7pINSdBhV7eiMUrQ/HbWMFlU5Ylq1FO0sbSytbaqqltKoCOL+/pHkjCOrS+QkvJ6Ph8eR677OfX+SHHHeuZbbOI4jAAAAAMCV8fN1AQAAAABQFhGmAAAAAMACYQoAAAAALBCmAAAAAMACYQoAAAAALBCmAAAAAMCCfyHH2TcdwA0nNjbrMSXFl1UAAIBSwuR3gJEpAAAAALBAmAI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Pfjgg159ly1bpnvvvVenTp3S2LFjNWzYMC1ZskSjR48uUq3nzp3T1KlT1ahRIz377LOaOXOm7rzzTv3lL39RbGyszp07l+s5q1atUkJCgu666y5Nnz5dzZs317Rp0zRlypRCr+dyuXTgwAF98803nrbk5GT5+fnpX//6l44dO+Zpd7vdCgsLU6tWrTxtjzzyiJ566ik1bNhQU6ZM0QsvvKBTp07pzjvv1N/+9jevaz3//PN64IEHVLFiRY0fP16TJ09WcHCw+vTpo1dffbXAOj/88EN17txZUVFR+uSTT1SvXr18+/7zn/9URkaG2rVrl+tYTEyMJN3QYYppfgAAACiyzMxMbd68WeXLl5ckNWnSRL/+9a/Vp08fbdq0yRMOBg4cqPr16+vVV19Vv379JElnz57VwIED1bZtW7ndbvn7Z70VHTx4sJo3b64RI0YoJSVFsbGxyszM1PDhw1WlShVt3bpVERERnr633XZbkWoNDAzU4cOHVaFCBU/bkCFD1L59ez3++ONavny5+vbt6/WcL7/8Ul9++aVnhGnIkCFq1qyZXnnlFY0ZM6bA67lcLo0dO1Zut1tRUVGSskLTQw89pIULF8rtdqtv375yHEcpKSnq1KmTypUrJykrOC5atEh/+tOf9MQTT3jOOXz4cMXExGj48OG6++67ZYzRjh07NHHiRCUmJurFF1/09P3Nb36jXr16KTExUf3791fFihVz1bhgwQINHDhQPXr00DvvvOP1tcnLd999J0mqXbt2rmM5bYcOHSrwHNczwhQAAEAx+9//lb74wtdVeGvRQpox4+rP8+STT3qClCR17NhRktS2bVuvUZby5curTZs22rhxo6fto48+0pEjRzRp0iSdPHnS67w9evTQiBEjtHbtWsXGxmr79u36z3/+o5EjR3qClCRVqlRJQ4YMKTTYSFlbgueEhczMTKWlpenChQtyuVySpC1btuQKU7169fKaqmeMUZcuXTRr1iydPn1aoaGh+V6vTZs2Cg0Nldvt1qBBg3TgwAHt27dPs2bN0hdffKHk5GT17dvXM0qVU4ckLVy4UBUrVlSvXr28RrAk6e6771ZSUpL27Nmjm2++WYsWLZIxRo8++miuvvfcc49WrF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U7f0nw9/eXvz9vu4vb+fPnNWzYMNWtW1cff/yxQkNDJUl33XWXWrZsqaSkJM2ZM+ea1sA0PwAAABRq3rx5MsZo3bp1Gj9+vKKiohQUFKR3333X02fbtm269957FRERocDAQEVHR2vixIm6cOFCrvO99957at68uYKCglSvXj298MILWrduXa41NPmtq/n555+VmJioqKgoBQYGqkaNGurfv78OHDjg1e/S57/55ptq2rSpAgMDVb9+fU2ZMqVIn/uBAwdkjNG4ceO82uPj42WM0fTp073a27Ztq1tuucXzcX5rpr788kt1797dMz3t4Ycf1g8//JBvHYsXL1aHDh1UsWJFBQcHq23btlqyZEmh9WdkZKhChQp69NFHvdoHDx4sY4yGDx/u1X7//fcrLCzM6/t26tQpjR49Wg0bNlRgYKAiIyP14IMPau/evXle78UXX1TTpk0VFBSkypUr6+6779bnn39eaK2SNH/+fAUEBKh37946e/Zsvv02bNig7777To8//rgnSElSixYtFBsbq8WLF+v8+fNFuqYtIjIAAACKbOTIkTp//rwGDRqksLAwRUdnTR/84IMPdN9996lhw4Z65plnVKVKFW3atEljx47VF198ob/+9a+ecyxevFgPPvigoqKiNG7cOPn7+2v+/PlauXJlkWo4f/684uPjtXHjRvXu3VvPPPOM9uzZo9dee01r167Vtm3bVKdOHa/nvP766zpy5IgGDhyoypUra+HChRo9erTq1Kmjhx56qMDr1a9fXzfddJPcbrdeeOEFSdK5c+f0ySefyM/PT263W08//bQk6aefftL27ds1ePDgAs+5b98+dezYURkZGXrqqadUt25drVy5Ut27d8+z//PPP6+JEyeqe/fuGj9+vPz8/LRs2TL16dNHs2bN0tChQ/O9VmBgoNq3b6/169d7tScnJ3vqz+E4jlJSUtSxY0fPaNqpU6fUvn17HTx4UAkJCWratKkOHz6s2bNnq23bttq2bZvq168vKet70717d3366ad65JFH9NRTT+nUqVN64403dMcdd+jvf/+7WrVqlW+tL774op577jkNHTpUM2fOlJ9f/mM/n332mSSpXbt2uY7FxMTI7XZr9+7datq0ab7nuFqEKQAAABRZenq6Pv/8c6+pfWfPntXAgQPVtm1bud1uz5vwwYMHq3nz5hoxYoRSUlIUGxurCxcuaMSIEYqMjNTWrVsVHh4uSXryySd12223FamGefPmaePGjXr22We9Rpfi4uLUs2dPJSYmasGCBV7POXjwoFJTU1WpUiVJUkJCgurXr69XXnml0DAlSS6XS/Pnz9eZM2cUHByszZs368yZM+rXr59WrFihCxcuyN/fXxs2bFBmZqZcLleB53vuuef0448/yu12q0uXLpKkoUOH6r777ss1grNjxw5NnDhRiYmJevHFFz3tv/nNb9SrVy8lJiaqf//+qlixYoH1u91u7dmzR40aNdLBgwf1zTffqF+/flq4cKGOHDmi6tWr69///rd++OEHr/rHjh2rvXv3avPmzWrevLmnfcCAAWrWrJnGjRvnGTmcNWuWUlJStGbNGsXHx3v6/s///I9uvfVWjRw5UikpKbnqu3jxooYNG6bZs2dr4sSJGjNmTIFfP0n67rvvJEm1a9fOdSyn7dChQ9c0TDHNDwAAAEX25JNP5loj9dFHH+nIkSN67LHHdPLkSR07dszzp0ePHpKktWvXSpK2b9+u7777TgMGDPAEKUkKDQ3VkCFDilTDsmXL5Ofnp8TERK/2X/3qV2rRooVWrFihixcveh177LHHPEFKkoKDgxUTE6M9e/YU6Zoul0vnz5/Xxx9/LElyu92qVq2ahg8frrS0NM8oyfr162WM8QSkvFy8eFErV65Uq1atvPoZYzRq1Khc/RctWiRjjB599FGvr+2xY8d0zz33KC0tTZs2bSq0/py6cx7LlSvnmYKY054zepXT33EcLVq0SJ06dVLt2rW9rh0SEqKYmBjP91aSFi5cqMaNG6tly5Zefc+dO6c777xTn3zyidLT071qO3v2rHr37q05c+Zo3rx5RQpSknTmzBlJynNjj5x1djl9rhVGpgAAAFBkN998c6621NRUSVmjPfk5cuSIJHm2rM6ZHnipvNrysm/fPtWqVcsrjOVo2rSpvvjiCx07dkzVqlXztN900025+latWlXHjx/3fHzq1Klcb/QjIyNVrlw5rzASHx/vGVG6/fbbFR4eLrfbrXbt2sntdqt58+aqUqVKvvX/8MMPOn36tBo3bpz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/fry5duuj7778v9PPp3LmzatasqT//+c86ffq0p/0f//iHUlJS1KdPn2t+s2dGpgAAAHBVQkJC9NZbb6lXr16Kjo5WQkKCGjZsqJMnT2rnzp1aunSpli1bptjYWPn7+2vatGl6+OGH1aZNGw0cOFD+/v6aN2+eqlatqn379nmmmOVnwIABmj9/vl566SXt379fnTp10tdff63Zs2erevXqXjveFafY2Fj5+fkpNTVVAwYM8LQ3adJENWrU0FdffaWYmJgCd9XLMWHCBK1evVo9e/bUsGHDVKdOHa1cuVJHjx7N1bd169ZKSkpSUlKSWrRooT59+qhWrVo6fPiwtm/frlWrVuncuXOFXrNFixaqUqWKUlNTFRsb6wmKYWFhatWqlbZs2aKaNWvmGv2aOHGiNm7cqL59+6pv376KiYlR+fLldeDAAa1atUotW7b07OY3fPhwffTRR3r22WfldrvlcrkUFhamgwcPKjk5WUFBQbm2aM/RoUMHrV27Vt27d1dsbKzcbneB00MDAgL0xz/+Uffff786duyoQYMG6aefftL06dMVGRnp2cb+WiJMAQAA4KrFx8frs88+0+TJk7Vw4UIdPXpU4eHhioqK0ogRI7y2PX/ooYcUEBCg8ePHa9y4capevboGDhyo2267Tffdd58qVKhQ4LUCAgL04YcfasKECVq8eLGWLl2qypUrq0+fPpowYYLX5gbFKTw8XC1atNCOHTtyTeVzuVx6++23C53ilyMqKkoff/yxnnnmGb3yyisKDAzUXXfdpQULFqh69eq5+o8bN06tWrXSzJkzNWPGDP3888+qVq2abr31Vs2cObNI1zTGKDY2VkuXLs1VZ9euXbVly5Y8dyGsVKmSNm7cqJdfflnvvvuuVqxYIX9/f9WpU0cdOnTQ448/7ukbEBCgDz74QLNnz9aCBQs8o121atVSmzZtct04+HIxMTFat26dunXrps6dO8vtdhf4/ezTp48qVKigCRMmaOTIkQoMDFTXrl310ksvXfP1UpJkchaV5aPAgwCu3Nx1RZsPDt+Z8kzWD+1RL/+nSP0T4oq2+xSA609qaupVrWGBt5dfflkjR47Upk2bFBMT4+tycAMo4r/hfIdKWTMFAAC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RVWW8s0yV9IWmG4zjcZB2lljEmRVLnfA7nes9sjGknaYKktsqa2veppETHcXZck/oIUwAAAABw5diAAgAAAAAsEKYAAAAAwAJhCgAAAAAsEKYAAAAAwAJhCgAAAAAsEKYAAAAAwAJhCgAAAAAsEKYAAAAAwAJhCgAAAAAsEKYAAD5ljIk1xjiX/TltjNlhjHnaGOPv6xoBAMgL/0EBAEqLdyStkmQk1ZDUX9IfJN0i6Qkf1gUAQJ6M4zi+rgEAcAMzxsRKWi/pWcdxpl3SHiJpp6Takqo7jnPUNxUCAJA3pvkBAEolx3F+lrRZWSNVUT4uBwCAXAhTAIDSLCdEnfBpFQAA5IE1UwCA0iLYGBOh/66ZGiLpl5K2Oo6z26eVAQCQB9ZMAQB86pI1U3lZKmmo4zjfl1xFAAAUDdP8AAClxRxJd0rqIWm0sqb21ZF09vKOxpjNxph+JVseAADemOYHACgt9jiOsy7776uNMZ9I+kTS65IeyOlkjPGT1EzSFyVfIgAA/8XIFACgVHIc51NJCyTdb4xpL0nGmBqSTkuqIGlz9s19O/mwTADADYwwBQAozcZLypT0e0nKXjuVIGmH4zih2X/+7ssCAQA3LsIUAKDUchzna0n/X1JXY0zH7ObbJe3wXVUAAGQhTAEASruJki4qe3RKhCkAQCnB1ugAgDLFGHNMUg/Hcbb6uhYAwI2NkSkAQJmRvZNfZV/XAQCARJgCAJQhjuNclDRN0trsnfwa+romAMCNi2l+AAAAAGCBkSkAAAAAsECYAgAAAAALhCkAAAAAsECYAgAAAAALhCkAAAAAsECYAgAAAAALhCkAAAAAsECYAgAAAAAL/wdbUWIcbNUviwAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 1080x360 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "font = {'family' : 'sans-serif',\n",
    "        'weight' : 'normal',\n",
    "        'size'   : 18}\n",
    "\n",
    "matplotlib.rc('font', **font)\n",
    "\n",
    "\n",
    "def simpleaxis(ax):\n",
    "    ax.spines['top'].set_visible(False)\n",
    "    ax.spines['bottom'].set_visible(False)\n",
    "    ax.spines['right'].set_visible(False)\n",
    "    ax.spines['left'].set_visible(False)\n",
    "\n",
    "c_ = sns.color_palette('Blues')\n",
    "f,ax = plt.subplots(1,1,figsize=(15,5))\n",
    "\n",
    "## R0\n",
    "sns.distplot(dfreport['median R0'],color=c_[5],ax=ax, kde=False, norm_hist=True, label='region-wide week 0')\n",
    "mu = np.median(dfreport['median R0'].values)\n",
    "print(mu)\n",
    "ax.axvline(mu,color='b',label='median week 0')\n",
    "print(dfreport['median R0'].quantile(q=[0.025,0.5,0.975]))\n",
    "\n",
    "## Rlast\n",
    "# sns.distplot(dfreport['median R0'],color=c_[1],ax=ax, kde=False, norm_hist=True,label='region-wide April 15th, 2020')\n",
    "# mu = np.median(dfreport['median Rlast'].values)\n",
    "# print(mu)\n",
    "# ax.axvline(mu,color='b',alpha=0.5,label='median April 15th, 2020')\n",
    "# print(dfreport['median Rlast'].quantiles(q=[0.025,0.5,97.5]))\n",
    "\n",
    "\n",
    "plt.legend()\n",
    "simpleaxis(ax)\n",
    "ax.get_yaxis().set_visible(False)\n",
    "ax.set_xlabel('')\n",
    "plt.subplots_adjust(hspace=0.5,bottom=0.1)\n",
    "ax.set_xlabel(r'R$_{t}$')\n",
    "plt.subplots_adjust(hspace=0.5,bottom=0.2)\n",
    "plt.savefig(productpath + 'Rpastpresent.png')\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
